OPC Studio User's Guide and Reference
Failure Recovery
Concepts > OPC Data Client Concepts > OPC Data Client Advanced Topics > Failure Recovery

The OPC communication may fail in various ways, or the OPC client may get disconnected from the OPC server. Here are some examples of such situations:

OPC Data Client handles all these situations, and many others, gracefully. Your application receives an error indication, and the component internally enters a “wait” period, which may be different for different types of problems. The same operation is not reattempted during the wait period; this approach is necessary to prevent system overload under error conditions. After the wait period elapses, OPC Data Client will retry the operation, if still needed at that time.

All this logic happens completely behind the scenes, without need to write a single line of code in your application. OPC Data Client maintains information about the state it has created inside the OPC server, and re-creates this state when the OPC server is disconnected and then reconnected. In OPC Classic, objects like OPC groups and OPC items are restored to their original state after a failure. In OPC UA, objects like OPC subscriptions and OPC monitored items are restored to their original state after a failure.

Even if you are using the subscriptions to OPC items (in OPC Classic) or to monitored items (in OPC UA) or events, OPC Data Client creates illusion of their perseverance. The subscriptions outlive any failures; you do not have to (and indeed, you should not) unsubscribe and then subscribe again in case of error. After you receive event notification which indicates a problem, simply stay subscribed, and the values will start coming in again at some future point.

In OPC Data Client-UA, you can call a static method EasyUAClient.RetryAll to force a retrial on all objects that are in a failure state. This method terminates the waiting delay, and causes all such objects to be retried on next opportunity.

See Also